package com.learn.spring.service;

import com.learn.spring.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class UserService {

    private List<User> list;
    private User user;

    public UserService() {
        System.out.println("userService constructor");
    }

    public UserService(User user) {
        this.user = user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public User getUser() {
        return user;
    }

    @Override
    public String toString() {
        return "UserService{" +
                "list=" + list +
                ", user=" + user +
                '}';
    }
}
